<?php


/**
 * user
 * 
 * @package   
 * @author 
 * @copyright stawiu
 * @version 2009
 * @access public
 */
class user{

	private $idUser;
	private $nick;
	private $pass;
	private $eMail;
	private $fName;
	private $mName;
	private $sName;
	private $age;
	private $birthDate;
	private $gender;
	private $avatar;
	private $street;
	private $city;
	private $postCode;
	private $country;
	private $communicators;//=array(array());
	
	function __construct($idUser) {

		$this->idUser=$idUser;
	
	}
	/**
	 * @return unknown
	 */
	public function getIdUser() {
		return $this->idUser;
	}
	
	/**
	 * @param unknown_type $idUser
	 */
	public function setIdUser($idUser) {
		primitiveTypes::int($idUser);
		$this->idUser = $idUser;
	}

	
	/**
	 * @return unknown
	 */
	public function getAge() {
		return $this->age;
	}
	
	/**
	 * @param unknown_type $age
	 */
	public function setAge($age) {
		primitiveTypes::int($age);
		$this->age = $age;
	}
	
	/**
	 * @return unknown
	 */
	public function getAvatar() {
		return $this->avatar;
	}
	
	/**
	 * @param unknown_type $avatar
	 */
	public function setAvatar($avatar) {
		// TODO validate data;
		$this->avatar = $avatar;
	}
	
	/**
	 * @return unknown
	 */
	public function getBirthDate() {
		return $this->birthDate;
	}
	
	/**
	 * @param unknown_type $birthDate
	 */
	public function setBirthDate($birthDate) {
		primitiveTypes::int($birthDate);
		$this->birthDate = $birthDate;
	}
	
	/**
	 * @return unknown
	 */
	public function getCity() {
		return $this->city;
	}
	
	/**
	 * @param unknown_type $city
	 */
	public function setCity($city) {
		primitiveTypes::string($city);
		$this->city = $city;
	}
	
	/**
	 * @return unknown
	 */
	public function getCountry() {
		return $this->country;
	}
	
	/**
	 * @param unknown_type $country
	 */
	public function setCountry($country) {
		primitiveTypes::string($country);
		$this->country = $country;
	}
	
	/**
	 * @return unknown
	 */
	public function getEMail() {
		return $this->eMail;
	}
	
	/**
	 * @param unknown_type $eMail
	 */
	public function setEMail($eMail) {
		primitiveTypes::string($eMail);
		$this->eMail = $eMail;
	}
	
	/**
	 * @return unknown
	 */
	public function getFName() {
		return $this->fName;
	}
	
	/**
	 * @param unknown_type $fName
	 */
	public function setFName($fName) {
		primitiveTypes::string($fName);
		$this->fName = $fName;
	}
	
	/**
	 * @return unknown
	 */
	public function getGender() {
		return $this->gender;
	}
	
	/**
	 * @param unknown_type $gender
	 */
	public function setGender($gender) {
		primitiveTypes::string($gender);
		$this->gender = $gender;
	}
	
	/**
	 * @return unknown
	 */
	public function getMName() {
		return $this->mName;
	}
	
	/**
	 * @param unknown_type $mName
	 */
	public function setMName($mName) {
		primitiveTypes::string($mName);
		$this->mName = $mName;
	}
	
	/**
	 * @return unknown
	 */
	public function getNick() {
		return $this->nick;
	}
	
	/**
	 * @param unknown_type $nick
	 */
	public function setNick($nick) {
		primitiveTypes::string($nick);
		$this->nick = $nick;
	}
	
	/**
	 * @return unknown
	 */
	public function getPass() {
		return $this->pass;
	}
	
	/**
	 * @param unknown_type $pass
	 */
	public function setPass($pass) {
		primitiveTypes::string($pass);
		$this->pass = $pass;
	}
	
	/**
	 * @return unknown
	 */
	public function getPostCode() {
		return $this->postCode;
	}
	
	/**
	 * @param unknown_type $postCode
	 */
	public function setPostCode($postCode) {
		primitiveTypes::string($postCode);
		$this->postCode = $postCode;
	}
	
	/**
	 * @return unknown
	 */
	public function getSName() {
		return $this->sName;
	}
	
	/**
	 * @param unknown_type $sName
	 */
	public function setSName($sName) {
		primitiveTypes::string($sName);
		$this->sName = $sName;
	}
	
	/**
	 * @return unknown
	 */
	public function getStreet() {
		return $this->street;
	}
	
	/**
	 * @param unknown_type $street
	 */
	public function setStreet($street) {
		primitiveTypes::string($street);
		$this->street = $street;
	}
	/**
	 * @return unknown
	 */
	public function getCommunicators() {
		return $this->communicators;
	}
	
	/**
	 * @param unknown_type $communicators
	 */
	public function setCommunicators($communicators) {
		$this->communicators = $communicators;
	}
	
	public function addCommunicator(communicator $communicator, $identification){
		//echo "size of ".sizeof($this->communicators);
		$this->communicators[sizeof($this->communicators)][0] = $communicator;
		primitiveTypes::string($identification);
		$this->communicators[sizeof($this->communicators)-1][1] = $identification;
	}
	
	public function remCommunicator(communicator $communicator){
		foreach ($this->communicators as $key=>$tempArray) {
			//$tempCommuniacator = $tempArray[0];
			if (isset($tempArray)){
			if ($tempArray[0]->getIdCommunicator()==$communicator->getIdCommunicator()){
					unset($this->communicators[$key]);
					break;	
			}
			}
		}
	}
	

}
?>